]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Add focusSearch() method and export it over DBus
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 17 May 2013 15:31:27 +0000 (17:31 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 17 May 2013 16:27:17 +0000 (18:27 +0200)
Some keyboard spot a dedicated search key, which gnome-settings-daemon
currently handles by spawning gnome-search-tool. It makes a lot of
sense to promote the Shell's integrated search feature instead, so
expose an appropriate DBus method g-s-d can use.

https://bugzilla.gnome.org/show_bug.cgi?id=700536

js/ui/overview.js
js/ui/shellDBus.js

index 12785adc8a8b5bc7e322dd5e38e3474325b7e0fe..d49f51a4aefc0cc8658545f0dd20bb9e2e763bb6 100644 (file)
@@ -477,6 +477,11 @@ const Overview = new Lang.Class({
         this._animateVisible();
     },
 
+    focusSearch: function() {
+        this.show();
+        this._searchEntry.grab_key_focus();
+    },
+
     fadeInDesktop: function() {
             this._desktopFade.opacity = 0;
             this._desktopFade.show();
index 952613b31d1ac7d65d4a45d4b28aa61cb7f7c4f2..84597fd933150e0133991a65f8485c4ae7f6b2cb 100644 (file)
@@ -21,6 +21,7 @@ const GnomeShellIface = <interface name="org.gnome.Shell">
     <arg type="b" direction="out" name="success" />
     <arg type="s" direction="out" name="result" />
 </method>
+<method name="FocusSearch"/>
 <method name="ShowOSD">
     <arg type="a{sv}" direction="in" name="params"/>
 </method>
@@ -116,6 +117,10 @@ const GnomeShell = new Lang.Class({
         return [success, returnValue];
     },
 
+    FocusSearch: function() {
+        Main.overview.focusSearch();
+    },
+
     ShowOSD: function(params) {
         for (let param in params)
             params[param] = params[param].deep_unpack();